//
// Created by wei.yang on 2021/8/24.定义宏防止文件重复引入
//

#ifndef ANDROIDFFMPEG_PCM_DECODER_CONTROLLER_H
#define ANDROIDFFMPEG_PCM_DECODER_CONTROLLER_H

#include <unistd.h>
#include <cstdio>
#include "pcm_real_decoder.h"

#define CHANNEL_PRE_FRAME = 2
#define BITS_PRE_CHANNEL = 16
#define BITS_PRE_BYTE = 8

#define QUEUE_SIZE_MAX_THRESHOLD 25
#define QUEUE_SIZE_MIN_THRESHOLD 20

class PCMDecoderController {
protected:
    FILE *pcmFile;
    //解码器
    RealDecoder *realDecoder;
    //采样率大小以及每个packet的大小
    int sampleRate;
    int packetBufferSize;
public:
    PCMDecoderController();

    ~PCMDecoderController();
    /**
     * 初始化
     * @param orgFilePath
     * @param pcmFilePath
     */
    void init(const char *orgFilePath, const char *pcmFilePath);
    /**
     * 解码
     */
    void decode();
    /**
     * 销毁
     */
    void destroy();

};


#endif //ANDROIDFFMPEG_PCM_DECODER_CONTROLLER_H
